package meal;

//Margarita Lee:mleeli | Last Updated: 10.23.11 - Set and Get Methods.

public class Direction{
	//Margarita Lee:mleeli | Last Updated: 10.18.11
	//Task: Define the variables for step.
	private String step;

	//Margarita Lee:mleeli | Last Updated: 10.18.11
	//Task: Start of the constructors.
	//Rahul Mohandas:rmohanda | Last Updated: 10.25.11
	//Task: updated Direction null constructor
	//Task: updated Direction null constructor to take in empty strings
	/**
	 * Creates an empty Direction with a blank step. The state of a blank step
	 * is met by a null.
	 */
	// Last updated: 10.25.11 - updated to create empty string instead of null
	public Direction(){
		setStep(null);
	}

	//Margarita Lee:mleeli | Last Updated: 10.18.11
	//Task: unformatted constructor
	//Rahul Mohandas:rmohanda | Last Updated: 10.23.11
	//Task: updated name of vars and how it works
	/**
	 *	Creates a new direction with the specified step(instruction).
	 *	@param s the step the direction contains.
	 */
	// Last updated: 10.23.11 - modified to call setStep(s) instead of seting
	// 		set step to s directly.
	public Direction(String s){
		setStep(s);
	}//End of the constructor methods.

	//Start of the set methods.
	//Margarita Lee:mleeli | Last Updated: 10.18.11
	//Task: setSteps method that allows the content of Step to be changed to store another String value if its required.
	//Rahul Mohandas:rmohanda | Last Updated: 10.25.11
	//Task: made it much more clear how to set a var
	//Task: made it so that setStep can check for null
	/**
	 * Sets the step associated with the Direction to the argument.
	 * @param s the step the direction contains.
	 */
	// Last updated: 10.25.11: Changed setStep to check for null
	public void setStep(String s){
		if (s != null)
			this.step = s;
		else
			this.step = "";
	}

	//Margarita Lee:mleeli | Last Updated: 10.18.11
	//Task: getSteps method that returns the String Step for when the object calls it.
	//Start of the get methods.
	//Rahul Mohandas:rmohanda | Last Updated: 10.23.11
	//Task: updated how the return method is making it clear what is being returned
	/**
	 * Returns the instructions for the step associated with this meal.
	 * @return returns the instructions for the step associated with this meal.
	 */
	public String getStep(){
		return this.step;
	}//End of the get methods.

	//Margarita Lee:mleeli | Last Updated: 10.23.11
	//Task:Updated it to toString instead of Directions.
	/**
	 *	Represents this direction as the instructions for the step, which is
	 *	itself a String.
	 *	@return string representing this direction.
	 */
	public String toString(){
		return getStep();
	}
}
